package com.origin.src.transaction;

import org.springframework.aop.framework.AopContext;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

@Transactional
@Component
public class TransactionBean {


    @Transactional
    public void test() {
        System.out.println("Transactional");
        ((TransactionBean) AopContext.currentProxy()).test1();
    }

    @Transactional(propagation = Propagation.REQUIRES_NEW)
    public void test1() {
        System.out.println("REQUIRES_NEW");
    }

}
